<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<link rel="stylesheet" type="text/css" href="${pageContext.request.contextPath}/static/easyui/themes/default/easyui.css">
<link rel="stylesheet" type="text/css" href="${pageContext.request.contextPath}/static/easyui/themes/icon.css">
<script type="text/javascript" src="${pageContext.request.contextPath}/static/easyui/jquery.min.js"></script>
<script type="text/javascript" src="${pageContext.request.contextPath}/static/easyui/jquery.easyui.min.js"></script>
<script type="text/javascript" src="${pageContext.request.contextPath}/static/easyui/locale/easyui-lang-zh_CN.js"></script>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>已办任务管理</title>
</head>
<body>
<table id="doneTable" fit="true"></table>


<div id="viewHistoryDialog">
	<table id="historyTable" fit="true"></table>

</div>

<div id="viewProcessDialog">
	<table id="processTable" fit="true"></table>

</div>
</body>
<script type="text/javascript">
$(function(){
	$("#doneTable").datagrid({
		url:"${pageContext.request.contextPath}/getYiBanTaskByPage",
		title:"已办任务管理",
		fitColumns:true,
		rownumbers:true,
		pagination:true,
		singleSelect:true,
		columns:[[
			{field:'ck',checkbox:"true"},
			{field:"taskId",title:"任务Id",width:2,align:"center"},
			{field:"taskName",title:"任务名称",width:3,align:"center"},
			{field:"createTime",title:"创建时间",width:2,align:"center"},
			{field:"overTime",title:"结束时间",width:2,align:"center"},
			{field:"leaveOperation",title:"操作",width:4,align:"center",formatter:leaveOperation},
		]]
	})
	
	$("#viewHistoryDialog").dialog({
			title:"查看历史批注",
			width:1000,
			height:400,
			closed:true
	})
	
	
	
	
	$("#viewProcessDialog").dialog({
			title:"流程执行过程",
			width:1000,
			height:400,
			closed:true
	})
	

})


function leaveOperation(value,row){
		return "<a href='javascript:viewProcess("+row.taskId+")'>流程执行过程</a>&nbsp;&nbsp;<a href='javascript:viewHistory("+row.taskId+")'>历史批注</a>&nbsp;&nbsp;<a href='#'>查看当前流程图</a>";
}

function viewProcess(taskId){
	$("#processTable").datagrid({
		url:"${pageContext.request.contextPath}/viewProcess?taskId="+taskId,
		title:"流程执行过程",
		fitColumns:true,
		rownumbers:true,
		singleSelect:true,
		columns:[[
			{field:'ck',checkbox:"true"},
			{field:"taskPointId",title:"任务节点Id",width:2,align:"center"},
			{field:"taskPointName",title:"任务节点名称",width:3,align:"center"},
			{field:"createTime",title:"开始时间",width:2,align:"center"},
			{field:"endTime",title:"结束时间",width:2,align:"center"}
		]]
	});
	$("#processTable").datagrid("load");
	$("#viewProcessDialog").dialog("open");
}


function viewHistory(taskId){
	$("#historyTable").datagrid({
		url:"${pageContext.request.contextPath}/viewHistory?taskId="+taskId,
		title:"批注列表",
		fitColumns:true,
		rownumbers:true,
		singleSelect:true,
		columns:[[
			{field:'ck',checkbox:"true"},
			{field:"reviewTime",title:"批注时间",width:2,align:"center"},
			{field:"reviewPerson",title:"批注人",width:3,align:"center"},
			{field:"reviewContent",title:"批注信息",width:2,align:"center"}
		]]
	});
	$("#historyTable").datagrid("load");
	$("#viewHistoryDialog").dialog("open");
}





</script>
</html>